package com.tencent.servlet;

import com.tencent.myssm.ViewBaseServlet;
import com.tencent.service.StudentServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: Fame
 * @date: 2022-06-22 15:00
 * @description:
 */
@WebServlet("/del.do")
public class DelServlet extends ViewBaseServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer id = Integer.valueOf(req.getParameter("id"));
        int num = new StudentServiceImpl().delete(id);
        System.out.println("num = " + num);
        resp.sendRedirect("student");
    }
}
